home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / system / mail / delivery / deliver.tz / deliver / samples / u-notify < prev    next >
Encoding:
Text File  |  1992-12-07  |  596 b   |  29 lines

  1. ***************
  2. *** 0 ****
  3. --- 1,25 ----
  4. + : u-notify
  5. + # A user delivery file that tells you when new mail arrives.
  6. + user="$1"
  7. + # Keep the mail.
  8. + echo $user
  9. + # Now notify myself (if I'm logged in).
  10. + T1=`who | awk '$1 == "'"$user"'" { print $2 }'`
  11. + if [ "$T1" ]
  12. + then
  13. +     # If I'm logged in multiple times,
  14. +     # write to the terminal that was most recently busy.
  15. +     T2=`cd /dev; ls -t $T1 | sed 1q`
  16. +     for t in $T2
  17. +     do
  18. +       echo "\n `date '+%D %H:%M'` --" \
  19. +            "you have new mail from `header -f From $HEADER`" \
  20. +            >/dev/$t
  21. +     done
  22. + fi
  23.